//
//  GDNewsLabel.m
//  爱新奇－味道
//
//  Created by 热带雨林 on 17/2/17.
//  Copyright © 2017年 热带雨林. All rights reserved.
//

#import "GDNewsLabel.h"

@implementation GDNewsLabel

+ (instancetype)addLabelWithTitle:(NSString *)title{
    
    GDNewsLabel *label = [[GDNewsLabel alloc]init];
    
    label.text = title;
    [label setTextAlignment:NSTextAlignmentCenter];
    label.textColor = [UIColor blackColor];
    //先设置大字体是需要将空间先撑开
    label.font = [UIFont systemFontOfSize:18];
    [label sizeToFit];
    label.font = [UIFont systemFontOfSize:15];
    
    label.userInteractionEnabled = YES;
    
    return label;
    
}
- (void)setProgress:(float)progress{
    
    _progress = progress;
    //由progress显示颜色
    [self setTextColor:[UIColor colorWithRed:progress green:0 blue:0 alpha:1]];
    
    CGFloat scale = (1.0 *18 / 15 -1)*progress;
    self.transform = CGAffineTransformMakeScale(1+scale, 1+scale);
    
}

@end
